﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/SiteMaster.Master"
    Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<%@ Import Namespace="Microhard.Framework.MVCHelper" %>
<%@ Import Namespace="Microhard.Permission.Extension" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    投诉管理
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="section-header">
        <div class="title">
            <img src="<%=Url.Content("~/Content/images/ico-catalog.png")%>" alt="" />
            投诉管理
        </div>
        <div class="options">
        </div>
    </div>
    <table width="100%">
        <tr>
            <td class="adminTitle">
                公司名称:
            </td>
            <td class="adminData">
                <%
                    Micrhard.FMCG.Server.Interface.IEmployee emp = Microhard.Core.IoC.Resolve<Micrhard.FMCG.Server.Interface.IEmployee>();
                    var cmp = emp.GetUserCompanyByUserName(Html.GetCurrentUserInfoFromSession().UserName);
                    List<SelectListItem> items = new List<SelectListItem>();
                    items.Add(new SelectListItem
                    {
                        Selected = true,
                        Text = cmp.Name,
                        Value = cmp.CompanyID.ToString()
                    });
                %>
                <%=Html.DropDownList("selCompany", items)%>
            </td>
        </tr>
    </table>
    <p>
    </p>
    <table class="adminContent">
        <tr>
            <td>
                <%Html.Telerik().Grid<Microhard.WeixinMP.Models.FeedbackModel>((List<Microhard.WeixinMP.Models.FeedbackModel>)this.Model.Data)
                    .Name("us-grid")
                         .ToolBar(t => t.Template(g =>
                    { 
                %>
                <%var searchParms = new Dictionary<string, string>();
                  searchParms.Add("BelongEntityID", "selCompany");
                %>
                <div class="header-menu">
                    <ul class="t-widget t-reset t-header t-menu">
                        <li class="t-item  t-state-default">
                            <%=Html.Authorized_SearchButton("btnSearch", "查询", "us-grid", searchParms, "OperationGridOnGridDataBinding")%>
                        </li>
                        <li class="t-item  t-state-default">
                            <%=Html.Authorized_UpdateButton("btnUpdate", "处理", "us-grid", "Update", "Feedback", "WX")%>
                        </li>
                    </ul>
                </div>
                <%}))
                   .ClientEvents(events => events.OnDataBinding("OperationGridOnGridDataBinding"))
                         .Columns(columns =>
                    {
                        columns.Bound(x => x.FeedbackID)
                      .Template(x => Html.CheckBox("checkedRecords", new { value = x.FeedbackID, @class = "gridCks" }))
                      .ClientTemplate("<input type='checkbox' name='checkedRecords' value='<#= FeedbackID #>' class='gridCks'/>")
                    .HtmlAttributes(new { style = "text-align:center" }).Title("请选择");
                        columns.Bound(x => x.QQMail).Title("联系方式");
                        columns.Bound(x => x.Content).Title("内容");
                        columns.Bound(x => x.CreateTime).Title("创建时间");
                        columns.Bound(x => x.Result).Title("处理结果");
                    })
                      .Pageable(settings => settings.Total(Model.Total).PageSize(Html.GetGridPageSize()).Position(GridPagerPosition.Top))
                      //绑定搜索按钮，执行对应的action
                    .DataBinding(dataBinding => dataBinding.Ajax().Select("_List", "Feedback"))
                    .EnableCustomBinding(true)
                    .Render();
                %>
            </td>
        </tr>
    </table>
</asp:Content>
